﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ADO.nettext
{
    class Program
    {
        static void Main(string[] args)
        {
            var connectionString = "server = .; uid = sa ; pwd = 123456 ; database = work";
            
            SqlConnection sc = new SqlConnection(connectionString);

            sc.Open();

            SqlCommand command = new SqlCommand("select * from Text",sc);


            //var reader = command.ExecuteReader();

            //while (reader.Read())
            //{
            //    Console.WriteLine("{0}\t{1}\t{2}", reader[0], reader[1], reader[2]);
            //}

            command.CommandText ="insert into Text values('孙尚香','女'),('诸葛亮','男'),('刘备','男')";
                command.ExecuteNonQuery();


            command.CommandText = "delete from Text where Id=2";
            command.ExecuteNonQuery();

            command.CommandText = "update Text set name='刘禅' where id=3";
            command.ExecuteNonQuery();
         
            sc.Close();

            

        }
    }
}
